<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.iamteer.contact.entity.Contact"%>
<%@page import="java.util.List"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset='UTF-8'>
		<title>所有联系人</title>
		<style type='text/css'>
			/*文字居中*/
			table td{
				text-align: center;
			}
			/*合并表格边框*/
			table{
				border-collapse: collapse;
			}
		</style>
	</head>
	<body>
		<center><h3>所有联系人(MVC)</h3></center>
		<table align='center' border='1'>
			<tr>
				<th>编号</th>
				<th>姓名</th>
				<th>性别</th>
				<th>年龄</th>
				<th>电话</th>
				<th>QQ</th>
				<th>邮箱</th>
				<th>操作</th>
			</tr>	
			<c:forEach items="${contacts }" var="con" varStatus="varSta">
				<tr>
					<td>${varSta.count }</td>
					<td>${con.name }</td>
					<td>${con.gender }</td>
					<td>${con.age }</td>
					<td>${con.phone }</td>
					<td>${con.email }</td>
					<td>${con.qq }</td>
					<td>
						<a href="${pageContext.request.contextPath }/QueryContact?id=${con.id}">修改</a>&nbsp;&nbsp;
						<a href="${pageContext.request.contextPath }/DeleteContact?id=${con.id}">删除</a>
					</td>
				</tr>
			</c:forEach>
			<tr>
				<td colspan='8'><a href='${pageContext.request.contextPath }/addContact.jsp'>[添加联系人]</a></td>
			</tr>
		</table>
		
	</body>
</html>